package com.enbatis.mybatisplugs.component;

import com.google.common.collect.Lists;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
//
//@Component
public class ThSender {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send() {
        System.out.println("Sender : " + 1);
        IotThData data = new IotThData();
        data.setCode("121212");
        data.setH(2+"");
        data.setT(21+"");
        List<IotThData> iotThDataList= Lists.newArrayList(data);

        this.rabbitTemplate.convertAndSend("iot-topic-th", iotThDataList.toString());
    }


}
